home *** CD-ROM | disk | FTP | other *** search
/ CICA 1993 April / CICA MS Windows - April 1993.iso / unzipped / util / winwait / winwait.pas < prev   
Pascal/Delphi Source File  |  1992-07-25  |  1KB  |  63 lines

  1. Program BootWindows;
  2.  
  3.         {  Outputs MSDOS errorlevel 0 to go to MS-Windows  }
  4.         {  errorlevel 1 to go to MS-DOS  }
  5.  
  6. uses Dos, Crt;
  7.  
  8. var
  9.    SendToDos:  word;
  10.    Counter:  integer;
  11.    GetKey:  char;
  12.  
  13. Procedure Timer;
  14.  
  15. begin
  16.  
  17.       Delay (1000);
  18.       Inc (Counter);
  19.       if Counter >= 180 then SendToDos :=0;
  20.  
  21. end;
  22.  
  23. Procedure Waiting;
  24.  
  25. begin
  26.  
  27.      if not KeyPressed then exit;
  28.      Getkey := ReadKey;
  29.      if GetKey = '1' then SendToDos :=0;
  30.      if GetKey = 'w' then SendToDos :=0;
  31.      if Getkey = 'W' then SendToDos :=0;
  32.      if GetKey = '2' then SendToDos :=1;
  33.      if GetKey = 'm' then SendToDos :=1;
  34.      if GetKey = 'M' then SendToDos :=1;
  35.      if GetKey = 'd' then SendToDos :=1;
  36.      if GetKey = 'D' then SendToDos :=1;
  37.      end;
  38.  
  39. begin
  40.  
  41.      SendToDos := 4;
  42.      Counter := 0;
  43.      writeln;
  44.      writeln ('Press:        for:');
  45.      writeln;
  46.      writeln ('  1           Microsoft Windows');
  47.      writeln;
  48.      writeln ('  2           MS - DOS');
  49.      writeln;
  50.      writeln;
  51.      writeln ('  MS-Windows will start in 3 minutes');
  52.  
  53.      repeat
  54.  
  55.            Timer;
  56.            Waiting;
  57.  
  58.      until SendToDos <> 4;
  59.  
  60.      Halt (SendToDos);
  61.  
  62. end.
  63.